#Region " Imports "

Imports BlazeApps.Library.Links

#End Region

Partial Class Usercontrols_Options_Links
    Inherits UserControlBase

#Region " Enums, Memebers and Properties "

#End Region

#Region " Page Events "

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        If Me.Page.IsPostBack = False Then
            BindDataItems()
        End If
    End Sub

#End Region

#Region " Save Data "



#End Region

#Region " Load Data "

    Public Overloads Overrides Sub BindDataItems()
        Dim List As New LinksList

        With Me.uxLinksRepeater
            .DataSource = List.GetLinks()
            .DataBind()
        End With
    End Sub

#End Region

#Region " Form Controls Events "

    Protected Sub DeleteLink(ByVal sender As Object, ByVal e As CommandEventArgs)

        LinksDetail.DeleteLinksDetail(ConvertToGuid(e.CommandArgument.ToString().Trim()))
        BindDataItems()

    End Sub

    Protected Sub uxLinksRepeater_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles uxLinksRepeater.ItemDataBound

        If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
            e.Item.Visible = ShowItem(ConvertToGuid(e.Item.DataItem("linkid").ToString))
        End If

    End Sub

#End Region

#Region " Helpers and Methods "



#End Region

End Class
